<?php
namespace app\front\logic;
use think\facade\Db;

//用户来源操作
class MemberLogLogic{
	static function addLog($member_id=0, $level=1, $is_first=0){
		if(!$member_id || !$level){
			return false;
		}

		$data = [];
		$data['member_id'] = $member_id;
		$data['after_level'] = $level;
		if($is_first){
			$data['current_level'] = 0;
		}else{
			
		}
		$data['create_time'] = date('Y-m-d H:i:s');

		$rs = Db::name('member_log')->insert($data);
		if(!$rs){
			return false;
		}else{
			return true;
		}
	}

}